x86/mm: Refactor possibly deadlocking get_gfn calls
authorAndres Lagar-Cavilla <andres@lagarcavilla.org>
Fri, 10 Feb 2012 16:07:07 +0000 (16:07 +0000)
committerAndres Lagar-Cavilla <andres@lagarcavilla.org>
Fri, 10 Feb 2012 16:07:07 +0000 (16:07 +0000)
commitbb9e2139bca549fb8fd52c6fef4054b3ebf9ff3e
tree5dfb86f77180ff6a36b22a975702619e10becd7f
parent4fbe3f3e71ed8f619adfe66302d636923ff0cb04
x86/mm: Refactor possibly deadlocking get_gfn calls

When calling get_gfn multiple times on different gfn's in the same function, we
can easily deadlock if p2m lookups are locked. Thus, refactor these calls to
enforce simple deadlock-avoidance rules:
 - Lowest-numbered domain first
 - Lowest-numbered gfn first

Signed-off-by: Andres Lagar-Cavilla <andres@lagarcavila.org>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
xen/arch/x86/hvm/emulate.c
xen/arch/x86/mm/mem_sharing.c
xen/include/asm-x86/p2m.h